import config from "@/config"
import http from "@/utils/request"

export default {
    importByTableNames: {
        url: `${config.API_URL}/tool/generator/table/importByTableNames`,
        name: "导入表结构",
        post: function (tableNameList) {
            return http.post(this.url, tableNameList);
        }
    },
    delTable: {
        url: `${config.API_URL}/tool/generator/table/del`,
        name: "多选级联删除",
        delete: function (tableIdList) {
            return http.delete(this.url, tableIdList);
        }
    },
    editTable: {
        url: `${config.API_URL}/tool/generator/table/edit`,
        name: "修改",
        put: function (toolGeneratorTableEditVo) {
            return http.put(this.url, toolGeneratorTableEditVo);
        }
    },
    getTableById: {
        url: `${config.API_URL}/tool/generator/table/info`,
        name: "根据ID获取详情",
        get: function (tableId) {
            return http.get(this.url + "/" + tableId);
        }
    },
    preview: {
        url: `${config.API_URL}/tool/generator/table/preview`,
        name: "代码预览",
        get: function (tableId) {
            return http.get(this.url + "/" + tableId);
        }
    },
    pageListTable: {
        url: `${config.API_URL}/tool/generator/table/pageList`,
        name: "分页查询列表",
        get: function (toolGeneratorTableQueryVo) {
            return http.get(this.url, toolGeneratorTableQueryVo);
        }
    },
    getTableListInDs: {
        url: `${config.API_URL}/tool/generator/table/getTableListInDs`,
        name: "获取当前数据源下的所有表",
        get: function (toolSelectTableQueryVo) {
            return http.get(this.url, toolSelectTableQueryVo);
        }
    }
}
